﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="TR_TrainingInstitute.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.TR_TrainingInstitute" %>
<%@ Register Src="../Controls/user.ascx" TagName="user" TagPrefix="uc1" %>

<%@ Register src="../Controls/DistrictCombo.ascx" tagname="DistrictCombo" tagprefix="uc2" %>

<asp:Content ID="ContentTRInstitute" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">        
            <script type="text/javascript">
                function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }                                
            </script>       
    </telerik:RadCodeBlock>
    
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="TRInstitute">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="TRInstitute" LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>    
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None" Skin="Outlook">
    </telerik:RadAjaxLoadingPanel>
    
    <asp:Panel ID="TRInstitute" runat="server">
        <table width="1000" cellpadding="0" cellspacing="0">
        <%--แถบ User & ข้อความ--%>
        <tr>
            <td valign="top">
                <!-- <uc1:user ID="user1" runat="server" /> -->
            </td>
        </tr>
        <tr>
            <td>
                <div class="moduleDivSlim1000x450">
                <div class="moduleDivBottom1000">
                    <table align="center" width="980px">
                    <tr>
                        <td align="left" class="tableHeader">
                            หน่วยงานที่จัดอบรม
                        </td>
                    </tr>
                    </table>
                    
                    <table align="center" style="height:390px; width: 964px;"> 
                    <tr> 
                        <td>
                            <asp:Panel ID="tblTRInstitute" 
                                        runat="server" 
                                        align="center" 
                                        Height="390px" 
                                        Visible="true"
                                        ScrollBars="Auto" 
                                        Width="980px">
                                        <telerik:RadGrid ID="grdTRInstitute"
                                            runat="server"
                                            AllowAutomaticDeletes="True" 
                                            AllowFilteringByColumn="True" 
                                            AllowMultiRowEdit="True" 
                                            AllowMultiRowSelection="True" 
                                            AllowPaging="True" 
                                            AllowSorting="True" 
                                            AutoGenerateColumns="False" 
                                            EnableAJAX="True" 
                                            EnableAJAXLoadingTemplate="True"
                                            GridLines="None" 
                                            Height="380px"
                                            Width="965px" 
                                            Skin="Outlook"
                                            OnItemCommand="grdTRInstitute_ItemCommand">
                                            <MasterTableView
                                                AllowMultiColumnSorting="True" 
                                                CellSpacing="-1" 
                                                ClientDataKeyNames="training_ins_seq" 
                                                CommandItemDisplay="Top"                                                         
                                                DataKeyNames="training_ins_seq"                                                    
                                                NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                                                <CommandItemTemplate>
                                                    <table align="left">
                                                    <tr>
                                                        <td align="left">
                                                        <asp:LinkButton ID="AddInstitute"
                                                                runat="server" 
                                                                CommandName="AddData"
                                                                Visible="true">
                                                                <img style="border:0px;vertical-align:middle;" alt=""
                                                                src="../Images/Buttons/AddRecord.gif" /> เพิ่มข้อมูลหน่วยงานที่จัดอบรม
                                                               
                                                        </asp:LinkButton>  
                                                        </td>
                                                        <td align="right">
                                                        
                                                        </td>
                                                    </tr>                                                   
                                                    </table>
                                                </CommandItemTemplate>
                                                <Columns>
                                                    <telerik:GridTemplateColumn  
                                                        HeaderStyle-Width="20px"                                                             
                                                        HeaderStyle-HorizontalAlign="Center"
                                                        ShowFilterIcon="false"
                                                        AllowFiltering="false">                                                        
                                                        <ItemTemplate>
                                                            <table>
                                                                <asp:ImageButton 
                                                                    ID="cmdEdit" 
                                                                    runat="server" 
                                                                    CommandName="DataEdit"
                                                                    OnClientClick="javascript: return confirm('แก้ไขข้อมูลที่เลือก?');"
                                                                    ImageUrl="../Images/Buttons/Edit.gif" 
                                                                    ToolTip="แก้ไขรายการ" 
                                                                    width="20px" />
                                                            </table>
                                                        </ItemTemplate>
                                                        <HeaderStyle HorizontalAlign="Center" Width="40px" />
                                                    </telerik:GridTemplateColumn> 
                                                    <telerik:GridTemplateColumn  
                                                        HeaderStyle-Width="20px"                                                             
                                                        HeaderStyle-HorizontalAlign="Center" 
                                                        ShowFilterIcon="false"
                                                        AllowFiltering="false">
                                                        <ItemTemplate>
                                                            <table>
                                                                <asp:ImageButton 
                                                                    ID="cmdDelete" 
                                                                    runat="server" 
                                                                    CommandName="Delete"
                                                                    OnClientClick="javascript: return confirm('ลบข้อมูลที่เลือก?');"
                                                                    ImageUrl="../Images/Buttons/Delete.gif" 
                                                                    ToolTip="ลบรายการ" 
                                                                    width="20px" />
                                                            </table>
                                                        </ItemTemplate>
                                                        <HeaderStyle HorizontalAlign="Center" Width="40px" />
                                                    </telerik:GridTemplateColumn> 
                                                    <telerik:GridBoundColumn 
                                                        AutoPostBackOnFilter="true" 
                                                        CurrentFilterFunction="Contains" 
                                                        DataField="training_ins_seq" 
                                                        DataType="System.Int32"
                                                        FilterControlWidth="100%" 
                                                        HeaderText="รหัส" 
                                                        ShowFilterIcon="false" 
                                                        UniqueName="training_ins_seq"
                                                        Visible="false">
                                                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </telerik:GridBoundColumn> 
                                                    <telerik:GridBoundColumn 
                                                        AutoPostBackOnFilter="true" 
                                                        CurrentFilterFunction="Contains" 
                                                        DataField="training_ins_descr" 
                                                        FilterControlWidth="100%" 
                                                        HeaderText="ชื่อหน่วยงานที่จัดอบรม " 
                                                        ShowFilterIcon="false" 
                                                        UniqueName="training_ins_descr"> 
                                                        <HeaderStyle HorizontalAlign="Center" />                                                          
                                                        <ItemStyle HorizontalAlign="Left" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn 
                                                        AutoPostBackOnFilter="true" 
                                                        CurrentFilterFunction="Contains" 
                                                        DataField="training_ins_responsible" 
                                                        FilterControlWidth="100%" 
                                                        HeaderText="ชื่อหน่วยงานต้นเรื่อง  " 
                                                        ShowFilterIcon="false" 
                                                        UniqueName="training_ins_responsible"> 
                                                        <HeaderStyle HorizontalAlign="Center" />                                                          
                                                        <ItemStyle HorizontalAlign="Left" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn 
                                                        AutoPostBackOnFilter="true" 
                                                        CurrentFilterFunction="Contains" 
                                                        DataField="country_name" 
                                                        FilterControlWidth="100%" 
                                                        HeaderText="ประเทศหน่วยงานที่จัดอบรม " 
                                                        ShowFilterIcon="false" 
                                                        UniqueName="country_name"> 
                                                        <HeaderStyle HorizontalAlign="Center" Width="180px"/>                                                          
                                                        <ItemStyle HorizontalAlign="Left" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn 
                                                        DataField="country_seq" 
                                                        DataType="System.Int32" 
                                                        Display="False" 
                                                        HeaderText="receive_type_seq" 
                                                        ReadOnly="True" 
                                                        UniqueName="country_seq" 
                                                        Visible="False">
                                            </telerik:GridBoundColumn>
                                                </Columns>
                                               <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                            </MasterTableView>
                                            <ClientSettings>
                                                <Selecting AllowRowSelect="true" />
                                                <Scrolling AllowScroll="true" UseStaticHeaders="True" />
                                            </ClientSettings>
                                        </telerik:RadGrid>
                            </asp:Panel>
                            <asp:Panel ID="InstituteEdit" 
                                    runat="server"
                                    Visible="false" 
                                    Height="380px" 
                                    width="980px" 
                                    align="center">
                                    <ul class="formList890px">
                                         <li>
                                            <table width="980px" align="center" >
                                                <tr>
                                                    <td align="left" class="tableDetailHeader" style="width: 980px">
                                                        ข้อมูลหน่วยงานที่จัดอบรม
                                                    </td>
                                                </tr>
                                            </table>
                                        </li>
                                        <li>
                                            <table  width="980px">
                                            <tr>
                                                <td align="right" width="150px">
                                                        ชื่อหน่วยงานที่จัดอบรม :
                                                </td>
                                                <td align="left">
                                                    <telerik:RadTextBox ID="txtTrainingInsDescr" runat="server" Width="300px"/>
                                                    <span class="validate">*</span>
                                                    <asp:RequiredFieldValidator 
                                                        runat="server" 
                                                        ID="RequiredFieldValidator6" 
                                                        ControlToValidate="txtTrainingInsDescr"
                                                        ErrorMessage="กรุณากรอกข้อมูลชื่อหน่วยงาน" >
                                                    </asp:RequiredFieldValidator>
                                                </td>
                                            </tr>                                                
                                            </table>
                                            <table  width="980px">
                                            <tr>
                                                <td align="right" width="150px">
                                                        ชื่อหน่วยงานต้นเรื่อง :
                                                </td>
                                                <td align="left">
                                                    <telerik:RadTextBox ID="txtTrainingInsRespons" runat="server" Width="300px"/>                                                   
                                                </td>
                                            </tr>                                                
                                            </table>
                                            <table width="980px">
                                            <tr>
                                                <td align="right" width="150px">
                                                     ประเทศของหน่วยงานที่จัดอบรม :
                                                </td>
                                                <td align="left">
                                                    <telerik:RadComboBox 
                                                        ID="ddlCountrySeq" 
                                                        Runat="server" 
                                                        Width="250px"
                                                        DataTextField="Name" 
                                                        DataValueField="Sequence"
                                                        EmptyMessage="&lt; เลือกประเทศ &gt;"  
                                                        AutoPostBack="true"
                                                        AllowCustomText="true" 
                                                        Filter="Contains"
                                                        OnClientTextChange="onTextChange">
                                                    </telerik:RadComboBox>                                                            
                                                    <span class="validate">*</span>
                                                    <asp:RequiredFieldValidator 
                                                        runat="server" 
                                                        ID="RequiredFieldValidator1" 
                                                        ControlToValidate="ddlCountrySeq"
                                                        ErrorMessage="กรุณากรอกข้อมูลประเทศ " >
                                                    </asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <telerik:RadTextBox ID="txtTrainingInsSeq" runat="server" Visible="false" Width="300px"/>
                                                </td>
                                            </tr>
                                            </table>                                          
                                        <table>
                                            <tr>
                                                <td>                                        
                                                    <asp:Label ID="lblError" runat="server" ForeColor="Red" Font-Size="Smaller" Font-Bold="true" />
                                                </td>                                     
                                            </tr>
                                        </table>  
                                        </li>                                         
                                    </ul>                                  
                                    
                                  <table width="600px">
                                    <tr>                                    
                                    <td align="right">
                                        <asp:Button ID="btnSave" onclick="btnSave_Click" runat="server" CssClass="button" Text="บันทึก" Width="80px" />   
                                        <asp:Button ID="btnUpdate" onclick="btnUpdate_Click" runat="server" CssClass="button" Visible="false" Text="แก้ไข" Width="80px" />                         
                                    </td>
                                    <td align="left">
                                        <asp:Button ID="btnCancel" OnClick="btnCancel_Click" runat="server" CausesValidation="false" CssClass="button" Text="ยกเลิก" Width="80px" />
                                    </td>
                                    </tr>
                                </table>
                                </asp:Panel>
                        </td>                     
                    </tr>
                    </table>
                </div>                 
                </div>              
            </td>
        </tr>
        </table>
    </asp:Panel>
    
</asp:Content>

